﻿using Microsoft.EntityFrameworkCore;
using mozhi.smarterp.Finance.EntityFrameworkCore;
using mozhi.smarterp.Finance.Logs.Repository;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;

namespace mozhi.smarterp.Finance.Logs
{
    public class OperationLogSettingRepository : EfCoreRepository<FinanceDbContext, OperationLogSetting, Guid>, IOperationLogSettingRepository
    {
        public OperationLogSettingRepository(IDbContextProvider<FinanceDbContext> dbContextProvider) : base(dbContextProvider)
        {
        }

        public async Task<OperationLogSetting> FindAsync(string code)
        {
            var template = await DbContext.Set<OperationLogSetting>().Include(x=>x.Items).FirstOrDefaultAsync(x=>x.Code == code);

            return template;
        }
    }
}
